import { useTranslations } from 'next-intl';
import { AuthForm } from '@/components/auth-form';
import { AuthRedirect } from '@/components/auth-redirect';

export default function Auth() {
    // 使用翻译钩子
    const t = useTranslations('auth');
    const commonT = useTranslations('common');
    
    return (
        <div className={`min-h-screen flex flex-col`}>
            <AuthRedirect />
            <main className="flex-1 flex items-center justify-center px-4 py-8">
                <div className="w-full max-w-md">
                    <div className="text-center mb-8">
                        <div className="flex items-center justify-center space-x-2 mb-4">
                            <div className="relative w-10 h-10 overflow-hidden rounded-md bg-primary">
                                <div className="absolute inset-0 flex items-center justify-center text-primary-foreground font-semibold text-lg">AI</div>
                            </div>
                            <span className="text-2xl font-medium tracking-tight">{commonT('appName')}</span>
                        </div>
                        <h1 className="text-2xl font-bold tracking-tight mb-2">
                            {t('welcomeBack')}
                        </h1>
                        <p className="text-muted-foreground">
                            {t('authDescription')}
                        </p>
                    </div>
                    <AuthForm />
                </div>
            </main>
            <footer className="py-6 border-t">
                <div className="container mx-auto text-center text-sm text-muted-foreground">
                    {new Date().getFullYear()} {commonT('appName')}. {t('allRightsReserved')}.
                </div>
            </footer>
        </div>
    );
}
